package com.nkym.wypan.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.nkym.wypan.model.context.fileinfo.*;
import com.nkym.wypan.model.entity.FileInfo;
import com.nkym.wypan.model.req.fileinfo.*;
import com.nkym.wypan.model.resp.ChunkUploadVo;
import org.springframework.core.io.Resource;
import org.springframework.http.ResponseEntity;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Set;


/**
* @author 19637
* @description 针对表【wy_pan_file_info】的数据库操作Service
* @createDate 2023-06-09 09:06:36
*/
public interface FileInfoService extends IService<FileInfo> {

    void secUpload(SecUploadReq secUploadReq);

    /**
     * 分片上传
     * @param chunkUploadReq
     */
    ChunkUploadVo chunkUpload(ChunkUploadContext chunkUploadReq);

    /**
     * 单文件上传
     * @param uploadReq
     */
    void upload(UploadContext uploadReq);

    void download(String code, HttpServletResponse response);

    void chunkMerge(ChunkMergeContext context);

    ResponseEntity<Resource> preview(String code);

    String getSourceCode(SourceCodeContext context);

    Set<Integer> shardingQuery(ShardingQueryContext shardingQueryContext);
}
